<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="com.sibco.client.system.User" %>
<%@ page import="com.sibco.client.common.UrlMap" %>
<%@ page import="com.bstek.dorado.utils.variant.VariantSet" %>
<%@ page import="com.bstek.dorado.data.db.DBStatement" %>
<%@ page import="java.util.List" %>
<%@ taglib uri="http://www.bstek.com/dorado" prefix="d" %>
<html>
<head>
<title>SIBCO客户端</title>
</head>
<style type="text/css">
.tabright {
    background-image: url(images/banner.jpg);
    filter: Alpha(Opacity=100);
}
td{
FONT-SIZE: 12px; LINE-HEIGHT: 15px; FONT-FAMILY: "Verdana", "Arial","新宋体", "宋体"
}
</style>
<body leftmargin="3" topmargin="0" marginwidth="0" marginheight="0">
<%
 User user = (User)session.getAttribute("User"); 
 String roleStr=user.getRoleStr();
 //System.out.println("kkkkkkkkkkkkkkkk="+roleStr);
%>
  <d:View>
   <%
   if (roleStr.indexOf(",2,")>=0 ||roleStr.indexOf(",3,")>=0||roleStr.indexOf(",4,")>=0){
       String sql="select f.FUNCTION_ID from clt_rt_function f,clt_rt_function_right fr "
                 +"where f.function_id=fr.function_id and fr.user_id="+user.getUserId()+" "
                 +"and f.super_function_id=20000000 ";
       DBStatement state=new DBStatement();  
       state.setSql(sql);
       List list=state.queryForList();
       state.close();       
       boolean sbTj=false,gjjTj=false,payrollTj=false,zdTj=false;//是否有社保、公积金、薪资、账单 统计
       for(int i=0;i<list.size();i++){
          VariantSet var=(VariantSet)list.get(i);
          if (var.getString("FUNCTION_ID").equals("20600000")){//社保
             sbTj=true;
          }
          if (var.getString("FUNCTION_ID").equals("20500000")){//公积金
             gjjTj=true;
          }
          if (var.getString("FUNCTION_ID").equals("20150000")){//薪资
             payrollTj=true;
          }
          if (var.getString("FUNCTION_ID").equals("20370000")){//账单
             zdTj=true;
          }
       }
       String[][] sPos={{"1","0"},{"402","0"},{"803","0"},{"1","281"},{"402","281"},{"803","281"}};
       int iCount=0;
       System.out.println("aaa:"+sPos[iCount][0]);
       System.out.println("aaa:"+sPos[iCount][1]);
   %>
       <d:SubWindow id="window1" title="员工统计" left="<%=sPos[iCount][0]%>" top="<%=sPos[iCount][1]%>" width="400" height="280" showCloseButton="false">
          <d:View config="com.sibco.client.statistics.empOrder" namespace="ns1">
            <d:AutoForm id="form1" />
            <d:DataTable id="table1" />
          </d:View>
        </d:SubWindow>
       <%
       iCount++;
       if (sbTj){
       %>
        <d:SubWindow id="window2" title="社保在缴统计" left="<%=sPos[iCount][0]%>" top="<%=sPos[iCount][1]%>" width="400" height="280" showCloseButton="false">
          <d:View config="com.sibco.client.statistics.socialAcc" namespace="ns2">
            <d:DataTable id="table1" />
          </d:View>
        </d:SubWindow>
      <%
         iCount++;   
       }       
       if (gjjTj){
      %>
        <d:SubWindow id="window3" title="公积金在缴统计" left="<%=sPos[iCount][0]%>" top="<%=sPos[iCount][1]%>" width="400" height="280" showCloseButton="false">
          <d:View config="com.sibco.client.statistics.socialAcc" namespace="ns3">
            <d:DataTable id="table2" />
          </d:View>
        </d:SubWindow>
      <%
         iCount++;   
       }       
       if (payrollTj){
      %>
        <d:SubWindow id="window4" title="薪资统计" left="<%=sPos[iCount][0]%>" top="<%=sPos[iCount][1]%>" width="400" height="280" showCloseButton="false">
          <d:View config="com.sibco.client.statistics.salaryStatCom" namespace="ns4">
            <d:AutoForm id="form1" />
            <d:DataTable id="table1" />
          </d:View>
        </d:SubWindow>
      <%
          iCount++;   
       }    
       if (zdTj){       
      %>
        <d:SubWindow id="window5" title="账单统计" left="<%=sPos[iCount][0]%>" top="<%=sPos[iCount][1]%>" width="400" height="280" showCloseButton="false">
          <d:View config="com.sibco.client.statistics.oughtReceive" namespace="ns5">
            <d:AutoForm id="form1" />
            <d:DataTable id="table1" />
          </d:View>
        </d:SubWindow>
      <%
          iCount++;   
       }          
      %>
   <%
   }else{     
      response.sendRedirect("../organization/comOrg.viewEmployee.d?EMPLOYEE_ID="+user.getEmployeeId()+"&COMPANY_ID="+user.getCompanyId());
   }
   %>
  </d:View>
</body>
</html>
